﻿using Autofac;
using FlyingEye.HttpServices;
using FlyingEye.Views.DeviceAppService;
using FlyingEye.Views.DeviceOpsService;
using FlyingEye.Views.MonitorServices;
using FlyingEyeAdmin.Shell;

namespace FlyingEye
{
    public class AutofacModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            // 令牌用作单例即可
            builder.RegisterType<HttpTokenManager>().SingleInstance();
            builder.RegisterType<HttpClientService>();

            builder.RegisterType<MainWindow>();
            builder.RegisterType<LoginWindow>();

            // 设备客户端
            builder.RegisterType<DeviceClientManagementWindow>();
            builder.RegisterType<DeviceConfigurationManagementWindow>();
            builder.RegisterType<DeviceHubWindow>();

            // 监视客户端
            builder.RegisterType<ClientManagementWindow>();
            builder.RegisterType<ReadNumericValueTaskManagementWindow>();
            builder.RegisterType<ReadStringValueTaskManagementWindow>();
            builder.RegisterType<NumericValueMonitorClientManagementWindow>();
            builder.RegisterType<NumericValueMonitorGroupManagementWindow>();
            builder.RegisterType<StringValueMonitorClientManagementWindow>();
            builder.RegisterType<StringValueMonitorGroupManagementWindow>();

            // 运维客户端
            builder.RegisterType<DeviceCharacteristicManagementWindow>();
            builder.RegisterType<DevicePartManagementWindow>();
            base.Load(builder);
        }
    }
}
